﻿using System.Xml.Linq;

namespace TKT.Lifter.CIM.Lifter.TibcoMsg.Lifter
{
    public class SCStateEventReport : MessageBody
    {
        public string MachineName { get; set; }
        public string UnitID { get; set; }
        public string SCStatus { get; set; }

        public SCStateEventReport()
            : base("SCState")
        { }

        public override System.Xml.Linq.XElement ToXElement()
        {
            XElement body = new XElement("Body");
            body.Add(new XElement("MACHINENAME", this.MachineName));
            body.Add(new XElement("UNITID", this.UnitID));
            body.Add(new XElement("SC_STATUS", this.SCStatus));
            return body;
        }

        public override void Parse(System.Xml.Linq.XElement body)
        {
            this.MachineName = body.Element("MACHINENAME").Value;
            this.UnitID = body.Element("UNITID").Value;
            this.SCStatus = body.Element("SC_STATUS").Value;
        }
    }
}
